#include<bits/stdc++.h>
#define ONLINE_JUDGE
#define ll long long
#define ull unsigned long long
using namespace std;

const ll N = 1e6 + 10, INF = 0x3f3f3f3f, MOD = 998244353;

ll n, k;
ll a[N], s[N], f[N];
map<ll, ll> hs;

void solve()
{
    cin >> n >> k;
    for (ll i = 1;i <= n;i++) {
        cin >> a[i];
        s[i] = s[i - 1] + a[i];
    }

    f[0] = hs[0] = 1;
    ll sum = 1;
    for (ll i = 1;i <= n;i++) {
        f[i] = (sum - hs[s[i] - k] + MOD) % MOD;
        hs[s[i]] = (hs[s[i]] + f[i]) % MOD;
        sum = (sum + f[i]) % MOD;
    }
    cout << f[n] << '\n';
}

signed main()
{
    // ios::sync_with_stdio(0);
    // cin.tie(0);cout.tie(0);
#ifndef ONLINE_JUDGE
    std::istringstream in(R"()");
    std::cin.rdbuf(in.rdbuf());
#endif
    ll T = 1;
    //cin>>T;
    for (ll i = 1;i <= T;i++) {
        solve();
    }
}